Memory-Model-Sensitive Data Race Analysis
نویسندگان
چکیده
We present a “memory-model-sensitive” approach to validating correctness properties for multithreaded programs. Our key insight is that by specifying both the inter-thread memory consistency model and the intra-thread program semantics as constraints, a program verification task can be reduced to an equivalent constraint solving problem, thus allowing an exhaustive examination of all thread interleavings precisely allowed by a given memory model. To demonstrate, this paper formalizes race conditions according to the new Java memory model, for a simplified but non-trivial source language. We then describe the implementation of a memory-model-sensitive race detector using constraint logic programming (CLP). In comparison with conventional program analysis, our approach does not offer the same kind of performance and scalability due to the complexity involved in exact formal reasoning. However, we show that a formal semantics can serve more than documentation purposes — it can be applied as a sound basis for rigorous property checking, upon which more scalable methods can be derived.
منابع مشابه
Sufficient Conditions for Implementing the Data-Race-Free-1 Memory Model†,∗
The paper, A Unified Formalization of Four Shared-Memory Models [AdH92], defines the data-race-free-1 memory model and informally discusses sufficient conditions for implementing the data-race-free-1 memory model. This note formalizes and gives correctness proofs for the sufficient conditions. This note does not stand alone. It should only be read as a supplement to the main paper [AdH92]. That...
متن کاملFormalizing Shared Memory Consistency Models for Program Analysis
Shared memory consistency models are critical for system correctness but difficult to analyze. The increasing popularity of multithreaded programming also creates a new challenge in how to help programmers reason about thread executions against the underlying memory consistency rules. This dissertation addresses the problem of formally specifying memory models to support program analysis. Two a...
متن کاملA Certified Data Race Analysis for a Java-like Language
A fundamental issue in multithreaded programming is detecting data races. A program is said to be well synchronised if it does not contain data races w.r.t. an interleaving semantics. Formally ensuring this property is central, because the JAVA Memory Model then guarantees that one can safely reason on the interleaved semantics of the program. In this work we formalise in the COQ proof assistan...
متن کاملHierarchical Pointer Analysis for Distributed Programs
We present a new pointer analysis for use in shared memory programs running on hierarchical parallel machines. The analysis is motivated by the partitioned global address space languages, in which programmers have control over data layout and threads and can directly read and write to memory associated with other threads. Titanium, UPC, Co-Array Fortran, X10, Chapel, and Fortress are all exampl...
متن کاملA Unified Formalization of Four Shared-Memory Models
This paper presents a shared-memory model, data-race-free-1, that unifies four earlier models: weak ordering, release consistency (with sequentially consistent special operations), the VAX memory model, and datarace-free-0. The most intuitive and commonly assumed shared-memory model, sequential consistency, limits performance. The models of weak ordering, release consistency, the VAX, and data-...
متن کامل